<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/static/include/top.jsp"%>
<script>document.title="用户导出";</script>

<form name="searchForm" action="" method="get">
<input type="hidden" name="p" value="1" />
	<table>
		<tbody>
			<tr>
				<th><img src="${ctx}/static/images/pages/cen/rig/ico_01.png" align="absmiddle">&nbsp;用户管理</th>
			</tr>
			<tr class="tab_grey">
				<td>用户名称： 
					<input type="text" name="loginName" id="loginName" value="${param['loginName']}" size="20" class="tab_textbut" />
					单位名称： 
					<input type="text" name="unitName" id="unitName" value="${param['unitName']}" size="20" class="tab_textbut" />
					<span class="tab_text">用户类型：</span>
					<select id="roleId" name="roleId">
						<option value="">请选择..</option>
						<c:forEach var="role" items="${roleList}">
							<option value="${role.id}">${role.roleName}</option>
						</c:forEach>
					</select>
					<input type="submit" value="查询" class="tab_but" /> 
					<input type="button" class="tab_but" value="清空" onclick="clearInput();"/> 
						<input type="button" class="tab_but"  onclick="exportUsers('${ctx}');" value="导出用户" onfocus="this.blur()"/>
		    		<input type="button" class="tab_but"  onclick="setExportFlag('${ctx}');" value="同步完成" onfocus="this.blur()"/>
					
				</td>
			</tr>
		</tbody>
	</table>
</form>
<script>
$("#roleId").val("${param['roleId']}");
function clearInput() {
	$("#loginName").val("");
	$("#unitName").val("");
	$("#roleId").val("");
}
</script>

<c:if test="${empty obj.operationResult}">
	<b>没有符合条件的记录。</b>
</c:if>
<c:if test="${not empty obj.operationResult}">
	<table id="listTable">
		<tbody>
			<tr>
			<th width="5%"><input type="checkbox" onclick="selectAll(this.checked);"></th>
				<th width="15%">用户名</th>
				<th width="25%">单位</th>
				<th width="15%">角色</th>
				<th width="15%">单位负责人</th>
				<th width="10%">联系电话</th>
				<th>操作</th>
				
			</tr>
			<c:forEach var="oneRow" items="${obj.operationResult}">
				<tr>
				<td><input name="chk"
					type="checkbox" id="chk" value="${oneRow.id}" /></td>
					<td align="left" >${oneRow.userLoginname}</td>
					<td align="left" >${oneRow.userUnit}</td>
					<td align="left" >${oneRow.roleName}</td>
					<td align="left" >${oneRow.userUnitAdmin}</td>
					<td align="left" >${oneRow.userContactPhone}</td>
					<td align="left">
						<a href="#" id="tab_text01" onclick="openViewWin('${oneRow.id}');return false;">详细</a>
					</td>
					
				</tr>
			</c:forEach>
			
			
			<tr class="tab_grey">
				<td colspan="7" align="center" valign="middle" class="tab_white">
				<div class="pagination"> 
					<%@ include file="../../include/listpage.jsp"%>
				</div>
				<div class="clear"></div>
				</td>
			</tr>
		</tbody>
	</table>
	<script>
	function selectAll(checkAllFlag) {
		var checkArray = document.getElementsByName("chk");
		for (var i = 0; i < checkArray.length; i++) {
			checkArray[i].checked = checkAllFlag;
		}
	}
	
	function openViewWin(id){
		openWin("查看详情","${baseURL}/dataManage/viewExportUser?id="+id,800,600);
	}
	</script>
	<script src="${ctx}/static/ocean/js/listUser.js"></script>
</c:if>

<%@ include file="/static/include/bottom.jsp"%>
